/* REBUILDING_OPERATIONS.H
 *
 * This file contains the rebuilding operations. While performing a
 * rebuilding operation, a new image is created while reading the old
 * values from the original one. After the operation, the original
 * image will be deleted. Making a copy and deleting the original
 * image is required for operations which need to read the orignal
 * value of pixels, for which a new value is already calculated.
 */

#pragma once

#include "image.h"
#include "operations.h"

//The setup methods return false to cancel the operation.
//The other (operation) methods return false on failure.

bool flipHorizontalSetup( Task *task );
bool flipHorizontal( Image &imgSource, Image &imgResult, void *data );

bool flipVerticalSetup( Task *task );
bool flipVertical( Image &imgSource, Image &imgResult, void *data );

bool medianSetup( Task *task );
bool median( Image &imgSource, Image &imgResult, void *data );

bool averageSetup( Task *task );
bool average( Image &imgSource, Image &imgResult, void *data );

//Declare a simple structure containing the settings made in embossSetup.
class EmbossSettings
{
public:
	int _xOffset, _yOffset;
};

bool embossSetup( Task *task );
bool emboss( Image &imgSource, Image &imgResult, void *data );

bool gaussSetup( Task *task );
bool gauss( Image &imgSource, Image &imgResult, void *data );

bool sobelHorizontalSetup( Task *task );
bool sobelHorizontal( Image &imgSource, Image &imgResult, void *data );

bool sobelVerticalSetup( Task *task );
bool sobelVertical( Image &imgSource, Image &imgResult, void *data );

bool laplaceSetup( Task *task );
bool laplace( Image &imgSource, Image &imgResult, void *data );

bool discreteCosineTransformSetup( Task *task );
bool discreteCosineTransform( Image &imgSource, Image &imgResult, void *data );
